<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>LeoPHP Framework JSON or JSONP</title>
</head>
<body>
  <h3>JSON 或者 JSONP 输出</h3>
  <p>请在config.php中设置：</p>
  <ul>
    <li>'core' => 'response' => 'json'</li>
    <li>'core' => 'response' => 'jsonp'</li>
  </ul>

  <h4>JSON</h4>
  <div id="json">等待JSON数据...</div>

  <h4>JSONP</h4>
  <div id="jsonp">等待JSONP数据...</div>

  <script src="../libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="../assets/js/app.js"></script>
  <script>
    $.ajax({
      url: _API,
      dataType: 'json',
      success: function(res) {
        $('#json').text(JSON.stringify(res))
      }
    })
    $.ajax({
      url: _API,
      dataType: 'jsonp',
      success: function(res) {
        $('#jsonp').text(JSON.stringify(res))
      }
    })
  </script>
</body>
</html>
